package com.dtw.ditouwang.beans;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class ChallengeListBean {

    /**
     * flag : Success
     * msg : 查询成功!
     * result : true
     * data : [{"id":4,"mileage":1000,"name":"1KM运动挑战"},{"id":5,"mileage":3000,"name":"3KM运动挑战"},{"id":6,"mileage":5000,"name":"5KM运动挑战"}]
     */

    private String flag;
    private String msg;
    private boolean result;
    private List<DataBean> data;

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean implements Parcelable {
        /**
         * id : 4
         * mileage : 1000
         * name : 1KM运动挑战
         */

        private int id;
        private float mileage;
        private boolean challenge;
        private boolean walk;
        private String name;

        public DataBean(){}

        protected DataBean(Parcel in) {
            id = in.readInt();
            mileage = in.readFloat();
            challenge = in.readByte() != 0;
            walk = in.readByte() != 0;
            name = in.readString();
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(id);
            dest.writeFloat(mileage);
            dest.writeByte((byte) (challenge ? 1 : 0));
            dest.writeByte((byte) (walk ? 1 : 0));
            dest.writeString(name);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel in) {
                return new DataBean(in);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public float getMileage() {
            return mileage;
        }

        public void setMileage(float mileage) {
            this.mileage = mileage;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public boolean isChallenge() {
            return challenge;
        }

        public void setChallenge(boolean challenge) {
            this.challenge = challenge;
        }

        public boolean isWalk() {
            return walk;
        }

        public void setWalk(boolean walk) {
            this.walk = walk;
        }

    }
}
